/**
 * 部门模型
 * Created by benben on 14-8-28.
 */
var db = require('./../../utils/mongodb/db');
var Schema = db.Schema;
var Page = require('../../utils/page/Page');

var departmentSchema  = new Schema({
    departmentName: String ,
    departmentNo: String ,
    //上级部门
    upDepartment: {
        _id : String,
        departmentName : String
    } ,
    //类型 0总公司,1普通部门,2行业组,3区域
    type: Number ,
    remark: String ,
    //0取消，1正常，2停用
    status: Number,
    //下面字段用于树
    children : [],
    leaf : Boolean
});

var Department = db.model('departments',departmentSchema);

module.exports = Department;